export function useSearchInput(search: IFn) {
    const searchText = ref("")
    const { state: searchCollapsed, toggle: toggleSearch } = useSwitch(true)
    function getSearchParams() {
        return {
            text: toValue(searchText)
        }
    }
    function handleInputSearch() {
        search()
    }
    function handleInputSwitch() {
        toggleSearch()
        searchText.value = ""
    }
    return {
        searchText,
        searchCollapsed,
        getSearchParams,
        handleInputSwitch,
        handleInputSearch
    }
}